package com.haixiaoke.saas.department.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.department.domain.ElectronicVisaSignProgress;
import com.haixiaoke.saas.department.mapper.ElectronicVisaSignProgressMapper;
import com.haixiaoke.saas.department.service.IElectronicVisaSignProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 电子签签署进度Service业务层处理
 * 
 * @author panda
 * @date 2024-06-13
 */
@Service
public class ElectronicVisaSignProgressServiceImpl implements IElectronicVisaSignProgressService {
    @Autowired
    private ElectronicVisaSignProgressMapper electronicVisaSignProgressMapper;

    /**
     * 查询电子签签署进度
     * 
     * @param id 电子签签署进度主键
     * @return 电子签签署进度
     */
    @Override
    public ElectronicVisaSignProgress selectElectronicVisaSignProgressById(Long id) {
        return electronicVisaSignProgressMapper.selectElectronicVisaSignProgressById(id);
    }

    /**
     * 查询电子签签署进度列表
     * 
     * @param electronicVisaSignProgress 电子签签署进度
     * @return 电子签签署进度
     */
    @Override
    public List<ElectronicVisaSignProgress> selectElectronicVisaSignProgressList(ElectronicVisaSignProgress electronicVisaSignProgress) {
        return electronicVisaSignProgressMapper.selectElectronicVisaSignProgressList(electronicVisaSignProgress);
    }

    /**
     * 新增电子签签署进度
     * 
     * @param electronicVisaSignProgress 电子签签署进度
     * @return 结果
     */
    @Override
    public int insertElectronicVisaSignProgress(ElectronicVisaSignProgress electronicVisaSignProgress) {
        electronicVisaSignProgress.setCreateTime(DateUtils.getNowDate());
        return electronicVisaSignProgressMapper.insertElectronicVisaSignProgress(electronicVisaSignProgress);
    }

    /**
     * 修改电子签签署进度
     * 
     * @param electronicVisaSignProgress 电子签签署进度
     * @return 结果
     */
    @Override
    public int updateElectronicVisaSignProgress(ElectronicVisaSignProgress electronicVisaSignProgress) {
        electronicVisaSignProgress.setUpdateTime(DateUtils.getNowDate());
        return electronicVisaSignProgressMapper.updateElectronicVisaSignProgress(electronicVisaSignProgress);
    }

    /**
     * 批量删除电子签签署进度
     * 
     * @param ids 需要删除的电子签签署进度主键
     * @return 结果
     */
    @Override
    public int deleteElectronicVisaSignProgressByIds(Long[] ids) {
        return electronicVisaSignProgressMapper.deleteElectronicVisaSignProgressByIds(ids);
    }

    /**
     * 删除电子签签署进度信息
     * 
     * @param id 电子签签署进度主键
     * @return 结果
     */
    @Override
    public int deleteElectronicVisaSignProgressById(Long id) {
        return electronicVisaSignProgressMapper.deleteElectronicVisaSignProgressById(id);
    }

    @Override
    public List<ElectronicVisaSignProgress> selectSignProgressByStateAndType(String contractId, String signProgress, String contractType) {
        return electronicVisaSignProgressMapper.selectSignProgressByStateAndType(contractId, signProgress, contractType);
    }

    @Override
    public int insertBatchElectronicVisaSignProgress(List<ElectronicVisaSignProgress> electronicVisaSignProgressList) {
        return electronicVisaSignProgressMapper.insertBatchElectronicVisaSignProgress(electronicVisaSignProgressList);
    }

    @Override
    public ElectronicVisaSignProgress selectSignProgressByName(String lesseeContractId, String signType, String contractType) {
        return electronicVisaSignProgressMapper.selectSignProgressByName(lesseeContractId, signType, contractType);
    }
}
